#ifndef ANIMATOR_H
#define ANIMATOR_H

#include <chrono>
#include "trackballinteractor.h"

namespace llx {

class Animator
{
public:
    typedef enum AnimationType{
        NONE,FIRST_PERSON,ORBIT,PAN,ROLL,ZOOM
    }AnimationType;

    Animator();
    ~Animator();

    void animate();
    double elapsedSeconds();
    void firstperson();
    void orbit();
    void pan();
    void roll();
    void zoom();
    void reset();
    void setAnimation(AnimationType type);
    void setScreenSize(int w,int h);
    void setInteractor(TrackBallInteractor *i);
    void stopwatch();


private:
    AnimationType mAnimation = NONE;
    TrackBallInteractor *mInteractor = nullptr;
    int mFrame = 0;
    int mFrames = 0;
    float mFramesPerSecond = 30.0f;
    int mHeight = 0;
    int mWidth = 0;
    std::chrono::time_point<std::chrono::system_clock>mTic;
};

}


#endif // ANIMATOR_H
